# -*- coding: utf-8 -*-
"""
Version: 0.1
Author: CarpeDiem
Date: 2022/3/30
Description: 计算个人所得税
"""


# 根据月收入算个税模块
def tax(monthmoney):
    # 最低起征点3500
    ds = 3500
    baoxian = 7662
    # 养老保险
    yanglao = monthmoney * 0.08
    # 医疗保险
    yiliao = monthmoney * 0.02
    # 失业保险
    shiye = monthmoney * 0.005
    # 公积金
    housem = monthmoney * 0.12
    # 计算三险一金总额，如超过上限按上限算
    demoney = yanglao + yiliao + shiye + housem
    if demoney >= 7662:
        demoney = 7662
    # 计算应征税额
    lastmoney = monthmoney - demoney - ds
    # 按不同档次征税，定义税额taxes
    if lastmoney <= 0:
        taxes = 0
    elif 0 < lastmoney < 1500:
        taxes = lastmoney * 0.03
    elif 1500 <= lastmoney < 4500:
        taxes = lastmoney * 0.1 - 105
    elif 4500 <= lastmoney < 9000:
        taxes = lastmoney * 0.2 - 555
    elif 9000 <= lastmoney < 35000:
        taxes = lastmoney * 0.25 - 1005
    elif 35000 <= lastmoney < 55000:
        taxes = lastmoney * 0.3 - 2002
    elif 55000 <= lastmoney < 80000:
        taxes = lastmoney * 0.35 - 5505
    elif 80000 <= lastmoney:
        taxes = lastmoney * 0.45 - 13505
    # if lastmoney < 0:
    #     taxes = 0

    return taxes


m = float(input("请输入您的月收入总额："))
taxes = tax(m)
print('您应征个人所得税金额为：{:.2f} 元'.format(taxes))